﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;
using Microsoft.VisualStudio.Tools.Applications.Runtime;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;


namespace NewFarpac
{
    public partial class Diagram
    {
        //System.Windows.Application g_AppWPF;

        private void Sheet10_Startup(object sender, System.EventArgs e)
        {
            //g_AppWPF = new System.Windows.Application();
        }

        private void Sheet10_Shutdown(object sender, System.EventArgs e)
        {
            //g_AppWPF.Shutdown();
        }

        #region VSTO Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.butTsHelper.Click += new System.EventHandler(this.button1_Click);
            this.Change += new Microsoft.Office.Interop.Excel.DocEvents_ChangeEventHandler(this.Sheet10_Change);
            this.Startup += new System.EventHandler(this.Sheet10_Startup);
            this.Shutdown += new System.EventHandler(this.Sheet10_Shutdown);

        }

        #endregion

        private void button1_Click(object sender, EventArgs e)
        {
            //button1.Enabled = false;
            //g_AppWPF.Run(new FarpacHelper.MainWindow(this));
            new FarpacHelper.MainWindow(Globals.ThisWorkbook.HelperConfig).ShowDialog();
        }

        private void Sheet10_Change(Excel.Range Target)
        {
            /*if (Target.Cells.Count > 1) return; // If more than 1 Cell Change mean not Choose from Drop Down list then return
            Excel.Range range = this.Application.Intersect(Target, Globals.Diagram.Range["C3"]);
            if (range == null) return; // If Target is not C3 then return
            //MessageBox.Show(range.Row.ToString() + "__" + range.Column.ToString());
             */
        }

    }
}
